package com.hm.service.http;

import okhttp3.OkHttpClient;

import java.util.concurrent.TimeUnit;

public class HttpUtils {
    //超时时间
    private static final int TimeOut = 60;

    public static OkHttpClient getOkHttpClient() {

        return new OkHttpClient.Builder()//
                .connectTimeout(TimeOut, TimeUnit.SECONDS)//连接超时时间
                .readTimeout(TimeOut, TimeUnit.SECONDS)//读取超时时间
                .writeTimeout(TimeOut, TimeUnit.SECONDS)//写入超时时间
                //.addInterceptor(new RetryInterceptor())//失败重试拦截器
                .build();
    }
}
